package hn.sigit.view.output;

import hn.sigit.util.GeneralUtils;

import java.math.BigDecimal;
import java.text.DateFormatSymbols;
import java.util.Calendar;
import java.util.Date;

public abstract class OutputHelperBase {
	private Calendar today;
	
	private final String[] months = new DateFormatSymbols().getMonths();

	
	public String spanishConvertNumberToWords(long number) {
		return GeneralUtils.spanishConvertNumberToWords(number);
	}
	public String spanishConvertNumberToWords(BigDecimal bd) {
		return GeneralUtils.spanishConvertNumberToWords(bd);
	}
	public String spanishConvertNumberToWords(BigDecimal bd, String intSuffix, String fractPrefix, String fractSuffix) {
		return GeneralUtils.spanishConvertNumberToWords(bd, intSuffix, fractPrefix, fractSuffix);
	}
	
	public Calendar getToday() {
		if (today == null) {
			today = Calendar.getInstance();
			today.setTime(new Date());
		}
		return today;
	}
	
	public int getTodaysDay() {
		return getToday().get(Calendar.DAY_OF_MONTH);
	}
	public String getTodaysMonth() {
		return months[getToday().get(Calendar.MONTH)];
	}
	public int getTodaysYear() {
		return getToday().get(Calendar.YEAR);
	}
}
